	function loadAndPrintPdfStr(base64str){

	 var pdfData = atob(base64str);
	  PDFJS.workerSrc = 'pdfjs/build/pdf.worker.js';  
	  PDFJS.getDocument({data: pdfData}).then(function getPdfHelloWorld(pdf) {
	    pdf.getPage(1).then(function getPageHelloWorld(page) {
	    //scale调节生成的图片大小
	    var scale = 1.45;
	      var viewport = page.getViewport(scale);

	      var canvas = document.getElementById('thepdfcanvas2');
	      var context = canvas.getContext('2d');
	      canvas.height = viewport.height;
	      canvas.width = viewport.width;

	      var renderContext = {
	        canvasContext: context,
	        viewport: viewport
	      };
//	      page.render(renderContext);
	      /*如需预览此处调toImageAndPreview*/
	      page.render(renderContext).promise.then(function(){
		      	toImageAndPrint();
		      });
	      
//	      setTimeout(toImageAndPrint,2000);
	    });
	  });
	
	}


	function toImageAndPrint(){
	  	var canvasEle = document.getElementById("thepdfcanvas2");
	  	var dataUrl = canvasEle.toDataURL();
	  	
	  	LODOP.PRINT_INIT("");
		LODOP.SET_PRINT_PAGESIZE(1, 0,0,"A5");
		LODOP.SET_PRINT_STYLE("Stretch",2);
		LODOP.ADD_PRINT_IMAGE("0mm","0mm","RightMargin:0mm","BottomMargin:0mm",dataUrl);
		LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
		var prt = LODOP.PRINT();
		return prt;
	  
	  }
	
	function toImageAndPreview(){
	  	var canvasEle = document.getElementById("thepdfcanvas2");
	  	var dataUrl = canvasEle.toDataURL();
	  	
	  	LODOP.PRINT_INIT("");
		LODOP.SET_PRINT_PAGESIZE(1, 0,0,"A5");
		LODOP.SET_PRINT_STYLE("Stretch",2);
		LODOP.ADD_PRINT_IMAGE("0mm","0mm","RightMargin:0mm","BottomMargin:0mm",dataUrl);
		LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
		var prt = LODOP.PREVIEW();
		return prt;
	  
	  }
	
	
